<template>
  <div>
    <Table :columns="columns" :data="colData" border></Table>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "RoomGuest",
  data() {
    return {
      colData: [],
      columns: [
        {
          width: 80,
          type: "index",
          title: "序号",
          align: "center",
        },
        {
          key: "userName",
          title: "姓名",
          algn: "center",
        },
        {
          key: "sex",
          title: "性别",
          algn: "center",
        },
        {
          key: "phone",
          title: "电话",
          algn: "center",
        },
        {
          key: "identy",
          title: "身份证号码",
          algn: "center",
        },
        {
          key: "roomNumber",
          title: "房号",
          algn: "center",
        },
      ],
    };
  },
  methods: {
    getUserByRoom(roomNumber) {
      axios
        .post("/api/user/getAllUserByNumber",
          {roomNumber}
        )
        .then((res) => {
          let data = res.data.data;
          this.colData = data ; 
        });
    },
  },
};
</script>
<style>
</style>